<template>

<div>
  <div class="list">
    <p>账户列表 <el-button type="primary" @click="updataAccountList">更新账户及余额</el-button></p>
  </div>
  <el-table
    :data="accounts"
    style="width: 100%">
    <el-table-column
      prop="id"
      label="id"
      width="380">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
      width="380">
    </el-table-column>
    <el-table-column
      prop="balance"
      label="余额">
    </el-table-column>
    <el-table-column
      prop="accountPath"
      label="账户地址">
    </el-table-column>
    <el-table-column
      prop="createMode"
      label="导入方式">
    </el-table-column>
  </el-table><br><br>

</div>


</template>

<script>
export default {
  name: "accountList",
  data() {
    return {
      accounts: "",
      mnemonic: "",
      accountInfo: "",
    }
  },
  mounted() {
    this.updataAccountList()
  },
  methods: {
    //点击更新按钮请求账户列表
    updataAccountList() {
      //发送请求
      this.axios.get("/getAllAccountByName").then(res => {
        this.accounts=res.data;
      })
    },
    unlockAccount() {
      //发送请求
      this.axios.post("/importRootByMnemonic",this.mnemonic).then(res => {
        this.accounts=res.data;
      })
    }
  }
}
</script>

<style scoped>
.list{padding:0;
  margin:0;
  text-align: left;
  list-style-type: none;}


</style>
